package com.syher.quartz.core;

import com.syher.quartz.task.model.TaskInfo;

import java.util.HashMap;

/**
 * Created by shenyuhang on 2018/3/7.
 */
public class TaskCache extends HashMap<String, TaskInfo> {

    public void add(String key, TaskInfo task) {
        if (!super.containsKey(key)) {
            super.put(key, task);
        }
    }

    public TaskInfo get(String key) {
        return super.getOrDefault(key, null);
    }

    public void remove(String key) {
        if (super.containsKey(key)) {
            super.remove(key);
        }
    }
}
